package com.neighbor.neighborhooduser.service.impl;

import com.neighbor.neighborhooduser.pojo.ItemCollections;
import com.neighbor.neighborhooduser.dao.IItemCollectionsDao;
import com.neighbor.neighborhooduser.pojo.UserItems;
import com.neighbor.neighborhooduser.service.IItemCollectionsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 物品收藏记录表 服务实现类
 * </p>
 *
 * @author song
 * @since 2025-09-22 09:13:04
 */
@Service
public class ItemCollectionsServiceImpl extends ServiceImpl<IItemCollectionsDao, ItemCollections> implements IItemCollectionsService {
    @Autowired
    private IItemCollectionsDao iItemCollectionsDao;
    @Override
    public Integer isCollect(Integer userId, Integer itemId) {
        return iItemCollectionsDao.isCollect(userId, itemId);
    }

    @Override
    public Integer collect(Integer userId, Integer itemId) {
        return iItemCollectionsDao.collect(userId, itemId);
    }

    @Override
    public Integer unCollect(Integer userId, Integer itemId) {
        return iItemCollectionsDao.unCollect(userId, itemId);
    }

    @Override
    public List<UserItems> getCollectionsById(Integer userId) {
        return iItemCollectionsDao.getCollectionsById(userId);
    }
}
